<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <title>UserLogin</title>
        <script type="text/javascript" src="<%=basePath%>/plugins/jquery.min.js"></script>

</head>
<body>
<div class="header1">
    <a href="#">
        <img src="images/logo.png">
    </a>
</div>
<div class="content1">	<!--背景颜色-->
    <div class="c1_box1"><!--背景图片-->
        <div class="login_box"><!--登陆框-->
            <div class="center1">
                <%--<form action="getuser" method="post">--%>
                    <h1>账号登陆</h1>
                    <h2>公共场所请不要泄露您的密码，以防止账号丢失
                    </h2>
                    <div class="si_box">
                        <span class="usr_icon">账号：</span>
                        <input type="text" name="uid" id="uid"/>
                    </div>
                    <!--分割条-->
                    <div class="c10"></div>
                    <div class="si_box">
                        <span class="pwd_icon">密码：</span>
                        <input type="password" name="pw" id="pw"/>
                    </div>
                    <div class="fg_box">
                        <a class="fg" href="forgetPassword.html">忘记登陆密码？</a>
                        <a class="treg" href="register.html">立即注册</a>
                    </div>
                    <div class="sub_box">
                        <input class="btn_submit" type="submit" id="submit" value="登陆"/>
                    </div>
                <%--</form>--%>

                <div class="com_box">
                    <span class="tencent"></span>

                </div>
            </div>
        </div>
    </div>
</div>
<div class="footer1">
    <div class="links">
        <a href="#">关于我们</a>|
        <a href="#">联系我们</a>|
        <a href="#">友情链接</a>|
        <a href="#">关于我们</a>|
        <a href="#">联系我们</a>|
        <a href="#">友情链接</a>
    </div>


    <img src="images/police.png">

</div>
<script type="text/javascript">
    $("#submit").click(function() {
        var obj = new Object();
        obj.uid = $("#uid").val();
        obj.pw = $("#pw").val();
        $.ajax({
            url: "getuser",
            type: "POST",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(obj),
            datatype: "json",
            success: function (data) {
                var jsonstr = eval("(" + data + ")");
                if (jsonstr.code==0){
                    alert(jsonstr.message)
                } else {
                    alert(jsonstr.message);
                    window.location.href="../canvas/listdo";
                }
            }
        })
    })
</script>
</body>
</html>







